package com.bingxue.edu.framework.common.validation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 名称格式校验注解
 * @author panbo
 */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = { NameValidation.class })
public @interface Name {
    String message() default "名称只能含有中文、数字、英文、下划线、短横线，长度为2-32位";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
